﻿using System;
using System.Collections.Generic;
using System.Text;

namespace SweetSQL.Data
{
    /// <summary>
    /// Class containing connection info, so you don't have to know connection string syntax
    /// </summary>
    public sealed class ConnectionParameters
    {
        /// <summary>
        /// Default ctor, Type defaults to SqlServer, CommandTimeout is 30
        /// </summary>
        public ConnectionParameters()
        {
            CommandTimeout = 30;
            CustomProperties = new Dictionary<string, string>();
            //These should be default enum values, I put them here for clarity
            ConnectionType = ConnectionType.SqlServer;
            SyntaxType = SyntaxType.SqlServer;
        }

        /// <summary>
        /// Server hostname, address, etc.
        /// </summary>
        public string DataSource
        {
            get;
            set;
        }

        /// <summary>
        /// Username for login
        /// </summary>
        public string Username
        {
            get;
            set;
        }

        /// <summary>
        /// Password for login
        /// </summary>
        public string Password
        {
            get;
            set;
        }

        /// <summary>
        /// Initial database
        /// </summary>
        public string Database
        {
            get;
            set;
        }

        /// <summary>
        /// Provider, only used by Oledb for now
        /// </summary>
        public string Provider
        {
            get;
            set;
        }

        /// <summary>
        /// Type of ADO connector, defaults to SqlServer
        /// </summary>
        public ConnectionType ConnectionType
        {
            get;
            set;
        }

        /// <summary>
        /// SQL syntax set to use, defaults to SqlServer
        /// </summary>
        public SyntaxType SyntaxType
        {
            get;
            set;
        }

        /// <summary>
        /// Command timeout in seconds, defaults to 30
        /// </summary>
        public int CommandTimeout
        {
            get;
            set;
        }

        /// <summary>
        /// Allows custom properties for connection string by key-value pair
        /// </summary>
        public Dictionary<string, string> CustomProperties
        {
            get;
            set;
        }
    }
}
